package com.lhj.springboot3.boot313security.controller;

import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description
 * @Author lhj
 * @Date 2024/7/7 16:24
 */
@RestController
public class HelloController {
    
    @GetMapping("/hello")
    public ResponseEntity<?> hello() {
        return ResponseEntity.ok("hello Security.");
    }
    
    @PreAuthorize("hasAuthority('file_exec')")
    @GetMapping("/word")
    public ResponseEntity<?> word() {
        return ResponseEntity.ok("word.");
    }
    
    
}
